setGlobalDuration(-1)

oscReceive(bus=['min', 'max'], address=['/min','/max'], port=8000)
randomh(bus='pit', mini=1, maxi=1, rate=8, miniVar='min', maxiVar='max')
sine(pitch=1, pitchVar='pit')

startCsound()

def ranger(list):
    sendOscControl(list[0], address='/min', port=8000)
    sendOscControl(list[1], address='/max', port=8000)

f = beginGUI(size=(250,100))
makeRangeSlider(f, [400,600], mini=300, maxi=1500, valtype='float', size=(200,20), function=ranger)
endGUI(f)